"""
字符串相关工具
"""


def str_reverse(s):
    """
    功能：对传入的字符串进行反转，再返回
    :param s:被反转的字符串
    :return:反转后的字符串
    """
    return s[::-1]


def substr(s, x, y):
    """
    功能：按照给定的下标对字符串进行切片
    :param s: 被切片的字符串
    :param x: 切片的开始下标x
    :param y: 切片的结束下标y
    :return:切片完成后的字符串
    """
    return s[x:y]


if __name__ == "__main__":
    print(str_reverse("疯狂星期四"))
    print(substr("疯狂星期四", 1, 3))
